Integrand size = 21, antiderivative size = 149 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\frac {a^2 \log (\cos (c+d x))}{d}-\frac {2 a b \sec (c+d x)}{d}+\frac {3 a^2 \sec ^2(c+d x)}{2 d}+\frac {2 a b \sec ^3(c+d x)}{d}-\frac {3 a^2 \sec ^4(c+d x)}{4 d}-\frac {6 a b \sec ^5(c+d x)}{5 d}+\frac {a^2 \sec ^6(c+d x)}{6 d}+\frac {2 a b \sec ^7(c+d x)}{7 d}+\frac {b^2 \tan ^8(c+d x)}{8 d} \]
[Out]
Time = 0.14 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.13, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3970, 962} \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\frac {\left (a^2-3 b^2\right ) \sec ^6(c+d x)}{6 d}-\frac {3 \left (a^2-b^2\right ) \sec ^4(c+d x)}{4 d}+\frac {\left (3 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}+\frac {a^2 \log (\cos (c+d x))}{d}+\frac {2 a b \sec ^7(c+d x)}{7 d}-\frac {6 a b \sec ^5(c+d x)}{5 d}+\frac {2 a b \sec ^3(c+d x)}{d}-\frac {2 a b \sec (c+d x)}{d}+\frac {b^2 \sec ^8(c+d x)}{8 d} \]
[In]
[Out]
Rule 962
Rule 3970
Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )^3}{x} \, dx,x,b \sec (c+d x)\right )}{b^6 d} \\ & = -\frac {\text {Subst}\left (\int \left (2 a b^6+\frac {a^2 b^6}{x}-b^4 \left (3 a^2-b^2\right ) x-6 a b^4 x^2+3 b^2 \left (a^2-b^2\right ) x^3+6 a b^2 x^4-\left (a^2-3 b^2\right ) x^5-2 a x^6-x^7\right ) \, dx,x,b \sec (c+d x)\right )}{b^6 d} \\ & = \frac {a^2 \log (\cos (c+d x))}{d}-\frac {2 a b \sec (c+d x)}{d}+\frac {\left (3 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}+\frac {2 a b \sec ^3(c+d x)}{d}-\frac {3 \left (a^2-b^2\right ) \sec ^4(c+d x)}{4 d}-\frac {6 a b \sec ^5(c+d x)}{5 d}+\frac {\left (a^2-3 b^2\right ) \sec ^6(c+d x)}{6 d}+\frac {2 a b \sec ^7(c+d x)}{7 d}+\frac {b^2 \sec ^8(c+d x)}{8 d} \\ \end{align*}
Time = 0.67 (sec) , antiderivative size = 138, normalized size of antiderivative = 0.93 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\frac {840 a^2 \log (\cos (c+d x))-1680 a b \sec (c+d x)+420 \left (3 a^2-b^2\right ) \sec ^2(c+d x)+1680 a b \sec ^3(c+d x)-630 \left (a^2-b^2\right ) \sec ^4(c+d x)-1008 a b \sec ^5(c+d x)+140 \left (a^2-3 b^2\right ) \sec ^6(c+d x)+240 a b \sec ^7(c+d x)+105 b^2 \sec ^8(c+d x)}{840 d} \]
[In]
[Out]
Time = 3.74 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.76
method | result | size |
parts | \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{6}}{6}-\frac {\tan \left (d x +c \right )^{4}}{4}+\frac {\tan \left (d x +c \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}\right )}{d}+\frac {b^{2} \tan \left (d x +c \right )^{8}}{8 d}+\frac {2 a b \left (\frac {\sec \left (d x +c \right )^{7}}{7}-\frac {3 \sec \left (d x +c \right )^{5}}{5}+\sec \left (d x +c \right )^{3}-\sec \left (d x +c \right )\right )}{d}\) | \(113\) |
derivativedivides | \(\frac {\frac {b^{2} \sec \left (d x +c \right )^{8}}{8}+\frac {2 a b \sec \left (d x +c \right )^{7}}{7}+\frac {a^{2} \sec \left (d x +c \right )^{6}}{6}-\frac {b^{2} \sec \left (d x +c \right )^{6}}{2}-\frac {6 a b \sec \left (d x +c \right )^{5}}{5}-\frac {3 a^{2} \sec \left (d x +c \right )^{4}}{4}+\frac {3 b^{2} \sec \left (d x +c \right )^{4}}{4}+2 a b \sec \left (d x +c \right )^{3}+\frac {3 a^{2} \sec \left (d x +c \right )^{2}}{2}-\frac {\sec \left (d x +c \right )^{2} b^{2}}{2}-2 a b \sec \left (d x +c \right )-a^{2} \ln \left (\sec \left (d x +c \right )\right )}{d}\) | \(155\) |
default | \(\frac {\frac {b^{2} \sec \left (d x +c \right )^{8}}{8}+\frac {2 a b \sec \left (d x +c \right )^{7}}{7}+\frac {a^{2} \sec \left (d x +c \right )^{6}}{6}-\frac {b^{2} \sec \left (d x +c \right )^{6}}{2}-\frac {6 a b \sec \left (d x +c \right )^{5}}{5}-\frac {3 a^{2} \sec \left (d x +c \right )^{4}}{4}+\frac {3 b^{2} \sec \left (d x +c \right )^{4}}{4}+2 a b \sec \left (d x +c \right )^{3}+\frac {3 a^{2} \sec \left (d x +c \right )^{2}}{2}-\frac {\sec \left (d x +c \right )^{2} b^{2}}{2}-2 a b \sec \left (d x +c \right )-a^{2} \ln \left (\sec \left (d x +c \right )\right )}{d}\) | \(155\) |
risch | \(-i a^{2} x -\frac {2 i a^{2} c}{d}-\frac {2 \left (210 a b \,{\mathrm e}^{15 i \left (d x +c \right )}-315 a^{2} {\mathrm e}^{14 i \left (d x +c \right )}+105 b^{2} {\mathrm e}^{14 i \left (d x +c \right )}+630 a b \,{\mathrm e}^{13 i \left (d x +c \right )}-1260 a^{2} {\mathrm e}^{12 i \left (d x +c \right )}+2226 a b \,{\mathrm e}^{11 i \left (d x +c \right )}-2765 a^{2} {\mathrm e}^{10 i \left (d x +c \right )}+735 b^{2} {\mathrm e}^{10 i \left (d x +c \right )}+3078 a b \,{\mathrm e}^{9 i \left (d x +c \right )}-3640 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}+3078 a b \,{\mathrm e}^{7 i \left (d x +c \right )}-2765 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+735 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+2226 a b \,{\mathrm e}^{5 i \left (d x +c \right )}-1260 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+630 a b \,{\mathrm e}^{3 i \left (d x +c \right )}-315 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+105 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+210 a b \,{\mathrm e}^{i \left (d x +c \right )}\right )}{105 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{8}}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(315\) |
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 146, normalized size of antiderivative = 0.98 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\frac {840 \, a^{2} \cos \left (d x + c\right )^{8} \log \left (-\cos \left (d x + c\right )\right ) - 1680 \, a b \cos \left (d x + c\right )^{7} + 1680 \, a b \cos \left (d x + c\right )^{5} + 420 \, {\left (3 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} - 1008 \, a b \cos \left (d x + c\right )^{3} - 630 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 240 \, a b \cos \left (d x + c\right ) + 140 \, {\left (a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 105 \, b^{2}}{840 \, d \cos \left (d x + c\right )^{8}} \]
[In]
[Out]
Time = 1.49 (sec) , antiderivative size = 252, normalized size of antiderivative = 1.69 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\begin {cases} - \frac {a^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {a^{2} \tan ^{6}{\left (c + d x \right )}}{6 d} - \frac {a^{2} \tan ^{4}{\left (c + d x \right )}}{4 d} + \frac {a^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} + \frac {2 a b \tan ^{6}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{7 d} - \frac {12 a b \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{35 d} + \frac {16 a b \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{35 d} - \frac {32 a b \sec {\left (c + d x \right )}}{35 d} + \frac {b^{2} \tan ^{6}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{8 d} - \frac {b^{2} \tan ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{8 d} + \frac {b^{2} \tan ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{8 d} - \frac {b^{2} \sec ^{2}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a + b \sec {\left (c \right )}\right )^{2} \tan ^{7}{\left (c \right )} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.19 (sec) , antiderivative size = 139, normalized size of antiderivative = 0.93 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\frac {840 \, a^{2} \log \left (\cos \left (d x + c\right )\right ) - \frac {1680 \, a b \cos \left (d x + c\right )^{7} - 1680 \, a b \cos \left (d x + c\right )^{5} - 420 \, {\left (3 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} + 1008 \, a b \cos \left (d x + c\right )^{3} + 630 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} - 240 \, a b \cos \left (d x + c\right ) - 140 \, {\left (a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 105 \, b^{2}}{\cos \left (d x + c\right )^{8}}}{840 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 415 vs. \(2 (137) = 274\).
Time = 3.31 (sec) , antiderivative size = 415, normalized size of antiderivative = 2.79 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=-\frac {840 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) - 840 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac {2283 \, a^{2} + 1536 \, a b + \frac {19944 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {12288 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {77364 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {43008 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {175448 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {86016 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {231490 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {53760 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {26880 \, b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {175448 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {77364 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {19944 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} + \frac {2283 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}}}{{\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{8}}}{840 \, d} \]
[In]
[Out]
Time = 17.89 (sec) , antiderivative size = 280, normalized size of antiderivative = 1.88 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=-\frac {\frac {64\,a\,b}{35}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (16\,a^2+\frac {256\,b\,a}{5}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2+\frac {512\,b\,a}{35}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {170\,a^2}{3}+\frac {512\,b\,a}{5}\right )-\frac {170\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}}{3}+16\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (\frac {256\,a^2}{3}+64\,a\,b-32\,b^2\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}-8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}+28\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-56\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+70\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-56\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+28\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {2\,a^2\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d} \]
[In]
[Out]